### STAGE 1: Build ###
FROM maven:3.6.3-jdk-8 as builder

COPY . /build
WORKDIR /build

RUN mvn  -Dmaven.wagon.http.ssl.insecure=true \
         -Dmaven.wagon.http.ssl.allowall=true \
         -Dmaven.wagon.http.ssl.ignore.validity.dates=true \
         -Dmaven.test.skip=true \
         -Dmaven.javadoc.skip=true \
    clean compile package --batch-mode


### STAGE 2: Run ###
FROM openjdk:8u212-b04-jre-slim as RUN

ENV TZ=Asia/Shanghai

COPY --from=builder /build/target/qiwen-file-1.2.8-SNAPSHOT.jar /app/semptian-file-center.jar

WORKDIR /app/
EXPOSE 8888/tcp
ENTRYPOINT [ "sh", "-c", " java -jar semptian-file-center.jar" ]
